package com.text.day3_1;

import java.util.Iterator;
import java.util.Random;
import java.util.SplittableRandom;

public class DieDai implements Iterator<String>{
    private int i = 10;
    @Override
    public boolean hasNext() {
        return i>0;
    }

    @Override
    public String next() {
        Random random = new Random();
        int len = random.nextInt(10);
        char[] ch = new char[len];
        for (int j = 0; j < len; j++) {
            ch[j] = (char) (random.nextInt(93) + 33);
        }
        i--;
        return new String(ch,0,ch.length);
    }

    public static void main(String[] args) {
        DieDai dieDai = new DieDai();
        while (dieDai.hasNext()) {
            System.out.println(dieDai.next());
        }
    }

}
